//
// GNS_IOSHelper.cpp
// MobileManageSys
//
// Created by mr.l on 16/1/15.
//
//

#include "GNS_IOSHelper.h"
USING_NS_CC;

#define winsize Director::getInstance()->getVisibleSize()


GNS_IOSHelper * GNS_IOSHelper::m_Instance =0;

GNS_IOSHelper::GNS_IOSHelper()
{
    
}

GNS_IOSHelper::~GNS_IOSHelper()
{
    
}

GNS_IOSHelper * GNS_IOSHelper::GetInstance()
{
    if (!m_Instance) {
        m_Instance = new GNS_IOSHelper();
    }
    return m_Instance;
}

bool GNS_IOSHelper::GetClipboard(std::string Test)
{
    bool IsSuccessful=false;
    UIPasteboard * pab = [UIPasteboard generalPasteboard];
    NSString * strPath = [NSString stringWithUTF8String:Test.c_str()];
    [pab setString:strPath];
    if (pab!=nil) {
        IsSuccessful=true;
    }else{
        IsSuccessful=false;
    }
    return IsSuccessful;
}
//std::string GNS_IOSHelper::conversion(NSString *itemId)
//{
//    std::string ConversionStr ="";
//    ConversionStr=  [itemId UTF8String];
//    
//    return ConversionStr;
//}
//NSString * GNS_IOSHelper::conversionStr(std::string itemstr)
//{
//    NSString *str= [NSString stringWithCString:itemstr.c_str() encoding:[NSString defaultCStringEncoding]];
//    return str;
//}
//// 获取设备名称
//std::string GNS_IOSHelper::GetIphoneName()
//{
//    NSString *strName = [[UIDevice currentDevice] name];
//    std::string IphoneName = conversion(strName);
//    return IphoneName;
//}
//// 获取设备系统名称
//std::string GNS_IOSHelper::GetIphoneSystem()
//{
//    NSString *strSysName = [[UIDevice currentDevice] systemName];
//    std::string IphoneSystem = conversion(strSysName);
//    return IphoneSystem;
//}
//// 获取系统版本
//std::string GNS_IOSHelper::GetIphoneSystemType()
//{
//    NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];
//    std::string SysVersion = conversion(strSysVersion);
//    return SysVersion;
//}
//// app名称
//std::string GNS_IOSHelper::GetAppName()
//{
//    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
//    NSString *AppName = infoDict[@"CFBundleName"];
//    std::string AppNM = conversion(AppName);
//    return AppNM;
//}
//// app版本
//std::string GNS_IOSHelper::GetAppBuild()
//{
//    NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
//    NSString *appVersion = infoDict[@"CFBundleShortVersionString"];
//    std::string AppVersion = conversion(appVersion);
//    return AppVersion;
//}
////手机型号
//std::string GNS_IOSHelper::GetIphoneModel()
//{
//    NSString* phoneModel = [[UIDevice currentDevice] model];
//    std::string IphoenModel = conversion(phoneModel);
//    return IphoenModel;
//}